﻿using Microsoft.EntityFrameworkCore.Migrations;

namespace DLL.NET50.DB.MS.LocalDrugs.Context.Migrations
{
    public partial class init1 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "adi_dic_drug",
                columns: table => new
                {
                    Drug_UniqueCode = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: false),
                    DRUG_CODE = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true),
                    DRUG_NAME = table.Column<string>(type: "text", nullable: true),
                    SPECIFICATION = table.Column<string>(type: "text", nullable: true),
                    DOSE = table.Column<float>(type: "float", nullable: false),
                    DOSE_UNIT = table.Column<string>(type: "text", nullable: true),
                    MAFC_NAME = table.Column<string>(type: "text", nullable: true),
                    SOLVENT_FLAG = table.Column<decimal>(type: "decimal(18, 2)", nullable: true),
                    PY_CODE = table.Column<string>(type: "text", nullable: true),
                    ApprovalNumber = table.Column<string>(type: "text", nullable: true),
                    BOTTLE_SIZE = table.Column<float>(type: "float", nullable: false),
                    BOTTLE_VOLUME = table.Column<float>(type: "float", nullable: false),
                    BOTTLE_THICKNESS = table.Column<float>(type: "float", nullable: false),
                    BOTTLE_TYPE = table.Column<int>(type: "int", nullable: false),
                    NEEDLE_TYPE = table.Column<decimal>(type: "decimal(18, 2)", nullable: true),
                    SOLUBILITY = table.Column<int>(type: "int", nullable: false),
                    ORIGINAL_PRESSURE = table.Column<int>(type: "int", nullable: false),
                    POSITIVE_PRESSURE = table.Column<int>(type: "int", nullable: false),
                    HAS_BUBBLE = table.Column<int>(type: "int", nullable: false),
                    Viscosity = table.Column<int>(type: "int", nullable: false),
                    FLUSH_MODE = table.Column<int>(type: "int", nullable: false),
                    OpenJawMode = table.Column<int>(type: "int", nullable: false),
                    InsolubleLoopCount = table.Column<int>(type: "int", nullable: false),
                    PumpBackLoopCount = table.Column<int>(type: "int", nullable: false),
                    OrgPullOutAire = table.Column<float>(type: "float", nullable: false),
                    InjcetBackDistance = table.Column<float>(type: "float", nullable: false),
                    InjcetBackSpeed = table.Column<int>(type: "int", nullable: false),
                    DropCrumb = table.Column<int>(type: "int", nullable: false),
                    PunctureSlowSpeed = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_adi_dic_drug", x => x.Drug_UniqueCode);
                });

            migrationBuilder.CreateTable(
                name: "adi_flushParams",
                columns: table => new
                {
                    Flush_UniqueCode = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: false),
                    Drug_UniqueCode = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true),
                    LoopIndex = table.Column<int>(type: "int", nullable: false),
                    DrugCountOfLoopFlush = table.Column<int>(type: "int", nullable: false),
                    OutLowOffset = table.Column<float>(type: "float", nullable: false),
                    FlushOffsetHeight = table.Column<float>(type: "float", nullable: false),
                    FLUSH_COST1 = table.Column<int>(type: "int", nullable: false),
                    FLUSH_COST2 = table.Column<int>(type: "int", nullable: false),
                    FLUSH_COST3 = table.Column<int>(type: "int", nullable: false),
                    FLUSH_COST4 = table.Column<int>(type: "int", nullable: false),
                    FlushMethod = table.Column<int>(type: "int", nullable: false),
                    SolventVolume = table.Column<float>(type: "float", nullable: false),
                    IN_VOLUME = table.Column<float>(type: "float", nullable: false),
                    FlushOutVolume = table.Column<float>(type: "float", nullable: false),
                    OUT_VOLUME = table.Column<float>(type: "float", nullable: false),
                    FlushAdditionOutVolume = table.Column<float>(type: "float", nullable: false),
                    FlushOutWait = table.Column<float>(type: "float", nullable: false),
                    FlushInSpeed = table.Column<int>(type: "int", nullable: false),
                    FlushOutSpeed = table.Column<int>(type: "int", nullable: false),
                    FlushOutSlowSpeed = table.Column<int>(type: "int", nullable: false),
                    RePullCount = table.Column<int>(type: "int", nullable: false),
                    RePullOutVolume = table.Column<float>(type: "float", nullable: false),
                    RePullInSpeed = table.Column<int>(type: "int", nullable: false),
                    RePullOutSpeed = table.Column<int>(type: "int", nullable: false),
                    FLUSH_AIRE = table.Column<float>(type: "float", nullable: false),
                    FlushInAirSpeed = table.Column<int>(type: "int", nullable: false),
                    FlushOutAirSpeed = table.Column<int>(type: "int", nullable: false),
                    PUMPING_WAIT = table.Column<float>(type: "float", nullable: false),
                    RePullPumping_Wait = table.Column<float>(type: "float", nullable: false),
                    ADDITIONAL_PUMPING = table.Column<float>(type: "float", nullable: false),
                    AdditionalOutAirVolume = table.Column<float>(type: "float", nullable: false),
                    BubbleFlushInSpeed = table.Column<int>(type: "int", nullable: false),
                    ViscosityFlushInSpeed = table.Column<int>(type: "int", nullable: false),
                    ViscosityInVolume = table.Column<float>(type: "float", nullable: false),
                    LastBottleAdditionOutVolume = table.Column<float>(type: "float", nullable: false),
                    FlushSolventPushBackSpeed = table.Column<int>(type: "int", nullable: false),
                    InjectorRinseCount = table.Column<int>(type: "int", nullable: false),
                    InjectorRinseVolume = table.Column<float>(type: "float", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_adi_flushParams", x => x.Flush_UniqueCode);
                    table.ForeignKey(
                        name: "FK_adi_flushParams_adi_dic_drug_Drug_UniqueCode",
                        column: x => x.Drug_UniqueCode,
                        principalTable: "adi_dic_drug",
                        principalColumn: "Drug_UniqueCode",
                        onDelete: ReferentialAction.Cascade);
                });

            migrationBuilder.CreateTable(
                name: "adi_PumpBackParams",
                columns: table => new
                {
                    PumpBack_UniqueCode = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: false),
                    Drug_UniqueCode = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true),
                    LoopIndex = table.Column<int>(type: "int", nullable: false),
                    PumpbackVolume = table.Column<float>(type: "float", nullable: false),
                    PumpBackInAire = table.Column<float>(type: "float", nullable: false),
                    PumpBackInAireSpeed = table.Column<int>(type: "int", nullable: false),
                    PumpBackOutSpeed = table.Column<int>(type: "int", nullable: false),
                    PumpBackWait = table.Column<float>(type: "float", nullable: false),
                    PumpBackEnableRepull = table.Column<int>(type: "int", nullable: false),
                    PumpBackRePullCount = table.Column<int>(type: "int", nullable: false),
                    PumpBackRePullVolume = table.Column<int>(type: "int", nullable: false),
                    PumpBacRePullkWait = table.Column<float>(type: "float", nullable: false),
                    PumpBackRePullInSpeed = table.Column<int>(type: "int", nullable: false),
                    PumpBackRePullOutSpeed = table.Column<int>(type: "int", nullable: false),
                    PumpBackSolventPushBackSpeed = table.Column<int>(type: "int", nullable: false),
                    InjectorRinseCount = table.Column<int>(type: "int", nullable: false),
                    InjectorRinseVolume = table.Column<float>(type: "float", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_adi_PumpBackParams", x => x.PumpBack_UniqueCode);
                    table.ForeignKey(
                        name: "FK_adi_PumpBackParams_adi_dic_drug_Drug_UniqueCode",
                        column: x => x.Drug_UniqueCode,
                        principalTable: "adi_dic_drug",
                        principalColumn: "Drug_UniqueCode",
                        onDelete: ReferentialAction.Cascade);
                });

            migrationBuilder.CreateIndex(
                name: "IX_adi_flushParams_Drug_UniqueCode",
                table: "adi_flushParams",
                column: "Drug_UniqueCode");

            migrationBuilder.CreateIndex(
                name: "IX_adi_PumpBackParams_Drug_UniqueCode",
                table: "adi_PumpBackParams",
                column: "Drug_UniqueCode");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "adi_flushParams");

            migrationBuilder.DropTable(
                name: "adi_PumpBackParams");

            migrationBuilder.DropTable(
                name: "adi_dic_drug");
        }
    }
}
